package stringSub;
/**
 * @Author forsake
 * @Description 区间一般都是左闭右开，索引下表从零开始
 * @Date 18:38 2022/11/28
 **/  
public class StringTest {
    public static void main(String[] args) {
        String s = "fahkakfhkhfka890809-=f-asf9afjal.a;.';[][]sdjifaj{}&*HDHKHDKHnkjjhk09080";
        int ah = s.indexOf("ah");
        // 左闭右开，索引下标从零开始
        String ah1 = s.substring(s.indexOf("ah"), s.indexOf("09-"));
        System.out.println(ah1);
    }
}
